﻿using NUnit.Framework;

namespace openxmlconv
{
    [TestFixture]
    public class ParagraphFixture
    {
        private Paragraph p1 = new Paragraph("string 1");
        private Paragraph p2 = new Paragraph("string 1");
        private Paragraph p3 = new Paragraph("string 2");
        [Test]
        public void TestEqualParagraph()
        {            
            Assert.AreEqual(p1,p2);
            Assert.AreNotEqual(p1,p3);
        }

        [Test]
        public void TestStyledParagraph()
        {
            Paragraph p1 = new Paragraph("string 1");
            Paragraph p2 = new Paragraph("string 1", Style.create("name", "family", "parentStyle"));
            Assert.AreNotEqual(p1,p2);            
        }
        [Test]
        public void TestNullStyle()
        {
            Paragraph p1 = new Paragraph("string 1");
            Assert.IsNull(p1.getStyle());
        }
        [Test]
        public void TestEqualityOfNullStyles()
        {
            Paragraph p1 = new Paragraph("string 1");
            Paragraph p2 = new Paragraph("string 2");
            Assert.IsNull(p1.getStyle());
            Assert.IsNull(p2.getStyle());
            Assert.IsTrue(p1.getStyle() == p2.getStyle());            
        }

    }
}
